﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.Bidder
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.Bidder;

    public class MapBidder : EntityMapping<Bidder>
    {
        public MapBidder()
        {
            Property(x => x.AreaName, map =>
            {
                map.Length(400);
            });

            ManyToOne(x => x.AttLicence, map =>
            {
                map.Column("AttLicenceId");
                map.NotNullable(false);
            });

            ManyToOne(x => x.AttOrganization, map =>
            {
                map.Column("AttOrganizationId");
                map.NotNullable(false);
            });

            ManyToOne(x => x.AttTax, map =>
            {
                map.Column("AttTaxId");
                map.NotNullable(false);
            });

            Property(x => x.BasicAccount, map =>
            {
                map.Length(400);
            });

            Property(x => x.BidderName, map =>
            {
                map.Length(400);
            });

            Property(x => x.BidderSimpleName, map =>
            {
                map.Length(100);
            });

            Property(x => x.BidderType, map =>
            {
                map.Length(40);
            });

            Property(x => x.ContactAddress, map =>
            {
                map.Length(4000);
            });

            Property(x => x.EconomicCode, map =>
            {
                map.Length(40);
            });

            Property(x => x.Email, map =>
            {
                map.Length(400);
            });

            Property(x => x.IndustryCode, map =>
            {
                map.Length(40);
            });

            Property(x => x.InfoReporterContactNumber, map =>
            {
                map.Length(40);
            });

            Property(x => x.InfoReporterName, map =>
            {
                map.Length(40);
            });

            Property(x => x.LicNumber, map =>
            {
                map.Length(40);
            });

            Property(x => x.LoginName, map =>
            {
                map.Length(40);
            });

            Property(x => x.OpeningBank, map =>
            {
                map.Length(400);
            });

            Property(x => x.Password, map =>
            {
                map.Length(40);
            });

            Property(x => x.RegCapCurrency, map =>
            {
                map.Length(40);
            });

            Property(x => x.RegCapital, map =>
            {
                map.Length(40);
            });

            Property(x => x.RegDescribe, map =>
            {
                map.Length(40000000);
            });
            
            Property(x => x.RegFlag);
            Property(x => x.RegDate);

            ManyToOne(x => x.RegUser, map =>
            {
                map.Column("RegUserId");
                map.NotNullable(false);
            });

            ManyToOne(x => x.Enterprise, map =>
            {
                map.Column("EntId");
                map.NotNullable(false);
            });

            Property(x => x.TaxNumber, map =>
            {
                map.Length(40);
            });

            Property(x => x.UnionNumber, map =>
            {
                map.Length(40);
            });

            Property(x => x.ZipCode, map =>
            {
                map.Length(40);
            });
        }
    }
}
